package cohesion.scene
{
	import flash.display.Bitmap;
	import flash.geom.Point;
	
	
	/**
	 * 平面直角坐标系场景
	 * @author 徐俊杰
	 * @date 2012-2-21
	 */
	public class SquareScene implements IScene
	{
		private var _id:int;
		private var _width:Number;
		private var _height:Number;
		private var _position:Point;
		
		public function SquareScene()
		{
		}
		
		public function moveTo(position:Point, w:Number, h:Number, speed:Number=Number.MAX_VALUE):void
		{
		}
		
		public function changeScene(id:int, position:Point):void
		{
			if(_id != id)
				_id = id;
			if(_position.equals(position))
				_position = position;
		}
		
		public function displayToGlobal(displayPoint:Point):Point
		{
			return displayPoint.add(position);
		}
		
		public function globalToDisplay(globalPoint:Point):Point
		{
			return globalPoint.subtract(position);
		}
		
		public function get id():int
		{
			return 0;
		}
		
		public function get position():Point
		{
			return _position;
		}
		
		public function set position(value:Point):void
		{
			if(_position != value)
			{
				_position = value;
			}
		}
		
		public function get width():Number
		{
			return _width;
		}
		
		public function set width(value:Number):void
		{
			if(_width != value)
			{
				_width = value;
			}
		}
		
		public function get height():Number
		{
			return _height;
		}
		
		public function set height(value:Number):void
		{
			if(_height != value)
			{
				_height = value;
			}
		}
	}
}